<?php
session_start();
if(! isset($_SESSION['id'])) {
    header('Location:index.html');
}
?>
<?php
if($_SESSION['id']!=='92'){
header('Location:index.html');
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>请假信息</title>
    <link href="css/bootstrap.min.css" type="text/css" rel="stylesheet">
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <style>
        .div{
            position: relative;
            text-align: center;
            padding-left: 500px;
        }
        .font{
            font-size: 16px;
            font-weight: bold;;
        }
        form{
            font-weight:bold;
        }
    body {
	background-color: #F2F2F2;
}
    .2 {
	color: #FFF;
}
.send {
  width: 60px;
  outline: none;
  border: none;
  background: rgb(0, 132, 255);
  height: 15px;
  cursor: pointer;
  color: #fff;
  border-radius: 20px;
  font: bold 14px '宋体';
  transition: all 0.5s;
  margin-top: 30px;
margin  auto 0;
  
}
    </style>
<script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="./js/main2.js"></script>
   

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="text-align: center; font-family: 'Comic Sans MS', cursive;">
<div align="center">
  <?php
include ("guanl.php");
?>
</div>
 
<form action='xiaoxix.php' method='post'>
<table class="table table-bordered table-hover">

  <tr>
        <th bgcolor="#7A8BB6"><div align="center">选择</div></th>
        <th bgcolor="#7A8BB6"><div align="center">id</div></th>
        <th bgcolor="#7A8BB6">对方</th>
        <th bgcolor="#7A8BB6"><div align="center">时间</div></th>
        <th bgcolor="#7A8BB6"><div align="center">自己</div></th>
        <th bgcolor="#7A8BB6"><div align="center">内容</div></th>
        <th bgcolor="#7A8BB6"><div align="center">账号</div></th>
        <th bgcolor="#7A8BB6"><div align="center">对方头像</div></th>
        
        
    </tr>
 <thead>
           
                <div class="send"onClick="set()">全选</div>
                <div class="send" onClick="sett()">取消</div>
              
        </thead>
<input type='submit' name='btnDels' value='彻底删除' onclick='return confirm(\"确定要彻底删除选中的信息吗？\");'/>
     <tbody id='dd'><tbody>
</table>


<script>

function mainq(){
    $.get('/mainq2.php',function(e){
        const data = JSON.parse(e)
        let dataVal = data.data;
        let divElement = ''
        for (let index = 0; index < dataVal.length; index++) {
            const element = dataVal[index];
            let a = `<tr>`

a+=`<th><input type='checkbox'  name='sel[]' value='`+element['id']+`'/></th>`
 a+=`<th>`+element['id']+`</th>`    
 a+=`<th>`+element['duif']+`</th>`    
 a+=`<th>`+element['ss']+`</th>`           
 a+=`<th>`+element['zj']+`</th>`
a+=`<th>`+element['nr']+`</th>`
a+=`<th>`+element['username']+`</th>`           
a += `<th><img class="yuanxing" src="`+element['duiimg']+`" width="80" style="border-radius: 50%; border: 1px solid #7492f6;padding: 1px; width:70px;height:70px;margin: 5px 5px 5px 0;
        position: absolute;
        border-radius: 5px;" /></th>`





a+=`
</tr>`
a+=`</form>`
a+=`</div>`
            
divElement += a;
            

        }
console.log('访问成功')

        $('#dd').html(divElement)


        

    })
}


$(function() {
    mainq();
    //

    setInterval(() => {
        mainq();
    }, 5000);
})
 
  </script>
<script>
function set(){

$("input").prop("checked",true);

}
function sett(){

$("input").prop("checked",false);

}
        </script>
</body>
</html>